import React, { Component } from "react"
import { withRouter } from "react-router-dom"
// withRouter 加工一般组件成为路由组件 因为一般组件无法使用 history

class About extends Component {
  gos = () => {
    console.log(1)
    this.props.history.go(1)
  }
  render() {
    return (
      <>
        <div>About</div>
        <button onClick={this.gos}>回退</button>
      </>
    )
  }
}

export default withRouter(About)